-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Post featured image: Add title attribute #46880
Conversation
Size Change: +185 B (0%) Total Size: 1.69 MB
ℹ️ View Unchanged
|
@carolinan So if the post has a title, the |
In principle, I don't see a benefit to encouraging the use of the title attribute. What is the feature in the image block that you're adding this to match? The only existing title field I'm aware of for images is in the media library, but that's the post title, which is used in list view as the link to the image, and is not used as a title attribute. (Image shows the usage of the title input field in the media library.) |
The option to add the title attribute to the image block is indeed different from the title field in the media library. The user is not informed that the post title is used instead of the title attribute. There needs to be a continued discussion about if the featured image block should also have the alt text setting that the image block has. I am torn because it is used conditionally, only when the block is not linked. |
Ugly. And the description field is not available in the image block at all, I see. I'd much rather see the description field available in the advanced area over the title attribute, even though that field is not used at all. I definitely agree that this needs to be made more coherent for both contexts, but I think that we don't want to encourage the use of title attributes. I'm 100% in favor of communicating more effectively to the user how various texts will be used, though. |
I am working on the caption as well, but I am unsure of where the media description would be used. |
Historically, it's been rarely used, usually only appearing on the attachment template in a classic theme. I don't believe there are any core functions that use it. That's why it would really only be suitable as an advanced field; it's almost certainly only going to be used in contexts with some degree of customization. Although I think it would be quite reasonable to make the image block output it when provided. If I were dreaming, I'd want to make a database change to swap the description with the alt attribute. The description is stored in post content, and the alt attribute is in post meta, and there are so many things that would be made easier if those were switched. |
I am also not sure that adding feature parity with the image block is encouraging the user, the setting is pretty well hidden. |
For reference: this is the pull request that added the title attribute to the Image block: #11070 Regarding the help text, I'm not sure the term I think it was done to try to explain it's about the purpose of the image, not necessarily the image content. However, it's still not that clear. Also, it's even more confusing when comparing with the Alt help text. Alt text: Title attribute: As a user, I'd be pretty confused. What's the difference between 'purpose' and 'role'? Ideally, this help text should be a bit rephrased to explain a few key concepts:
I do realize communicating these concepts in a short sentence is hard. It would be great to find a better prhasing though and update the Image block help text as well. |
Overall, I'd say both the Media Library and the editor user interface don't explain very well that all these fields are meant for. It's true that themes and plugins can use these values for any purpose and even use them wrongly, However, conceptually, some fields belong to the post attachment while others belong to the image. For xample: Title and Description are mainly properties of the post attachment. The UI doesn't do a great job to separate these properties. They're all mixed up and not explained very well. This is a separate issue though and should be addressed holistically in WP core and the editor. Some consistency would be great too. |
Flaky tests detected in 68b7f0e. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6507082606
|
Keeping in mind that WordPress should not encourage the use of the title attribute, I'd recommend to rephrase all the occurrences of the help text for this field, for all blocks. The current text:
Doesn't explain very well that this field is only meant for additional, optional, description. Do not use it for important information, as by its own nature the title attribute content is not available to all users. |
I believe that would need to be a separate issue. |
This has gone stale and there are too many merge conflicts, closing. |
What?
This PR adds an option to add a title attribute to the post featured image. The setting is in the Advanced panel in the block settings sidebar.
Why?
There are inconsistencies between the available features for the image block and the post featured image block.
This PR is meant to reduce one of these inconsistencies to make it easier for users to use the blocks.
How?
Testing Instructions
Screenshots or screencast